#!/usr/bin/js

function fila_tabla(){
  this.fila = new Array();
  this.agregarColumna = function(valor) {
    this.fila.push(valor);
  };
  
  this.eliminarColumna = function(indice){
    this.fila.splice(indice);
  }
  
  this.marca = function(m) {
    return "<"+m+">";
  };
  
  this.finmarca = function(m) {
    return "</"+m+">";
  };
  
  this.celda = function (contenido) {
    return this.marca("td")+contenido+this.finmarca("td");
  };
  
  this.toHTML = function(){
    var html='';
    html += this.marca('table')+'\n';
    html += '\t'+this.marca('tr')+'\n';
    for (var i in this.fila){
      html += '\t\t'+this.celda(i)+'\n';
    }
    html += '\t'+this.finmarca('tr')+'\n';
    html += this.finmarca('table')+'\n';
    return html;
  };
};

var fila = new fila_tabla();
for (var i=0; i<6; i++){
  fila.agregarColumna(i);
}

print (fila.toHTML());
